import 'package:mziot/app/data/user_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

UserEntity $UserEntityFromJson(Map<String, dynamic> json) {
  final UserEntity userEntity = UserEntity();
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    userEntity.nickName = nickName;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    userEntity.userId = userId;
  }
  final String? token = jsonConvert.convert<String>(json['token']);
  if (token != null) {
    userEntity.token = token;
  }
  final dynamic? userHeadImg = jsonConvert.convert<dynamic>(json['userHeadImg']);
  if (userHeadImg != null) {
    userEntity.userHeadImg = userHeadImg;
  }
  final String? userTimeZone = jsonConvert.convert<String>(json['userTimeZone']);
  if (userTimeZone != null) {
    userEntity.userTimeZone = userTimeZone;
  }
  final bool? isRegister = jsonConvert.convert<bool>(json['isRegister']);
  if (isRegister != null) {
    userEntity.isRegister = isRegister;
  }
  final bool? isNeedSetTimezone = jsonConvert.convert<bool>(json['isNeedSetTimezone']);
  if (isNeedSetTimezone != null) {
    userEntity.isNeedSetTimezone = isNeedSetTimezone;
  }
  return userEntity;
}

Map<String, dynamic> $UserEntityToJson(UserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['nickName'] = entity.nickName;
  data['userId'] = entity.userId;
  data['token'] = entity.token;
  data['userHeadImg'] = entity.userHeadImg;
  data['userTimeZone'] = entity.userTimeZone;
  data['isRegister'] = entity.isRegister;
  data['isNeedSetTimezone'] = entity.isNeedSetTimezone;
  return data;
}
